home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 215
/
215.d81
/
modstar copier
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
290 lines
10 dv=peek(186):if dv<8 then dv=8
20 close15:open15,dv,15,"i":close15
100 poke147,0:sys57812"mod copier.o",dv,1:sys62631
105 goto305
106 dv=peek(186):if dv<8 then dv=8:rem dv defined again because of clr command
107 close15:open15,dv,15,"i":close15
110 sys sd,dn$,bf%,nf%,fi$(.),nb%(.),ft%(.),s%(.),tr%(.),se%(.),l$(.):return
115 rem issued in line 305
120 poke214,4:print:printtab(11)"[154]"s$(cs)
125 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,2
130 poke214,6:print:fora=1to14
135 print" "
140 next
143 close15:open15,dv,15,"i":close15
145 return
150 poke214,21:print
155 fora=1to2:print" ":next
160 print"[145][145]";:return
165 b=.:fora=8to11:open15,a,15:close15
170 d(a-7)=.:ifst=.thend(a-7)=a:b=b+1
175 next:fora=1to4:ifd(a)<>.thensd%=d(a):a=4
180 next:ifb=1thentd%=sd%:return
185 fora=sd%-6to4:ifd(a)<>.thentd%=d(a):a=4
190 next:return
195 hi=int(a/256):lo=a-hi*256:return
200 open15,sd%,15,"i0":input#15,er,er$,tr,se:close15:ok=-1:ifer=.thenreturn
205 poke214,15:print:fora=1to3:print" "
210 next:print"[145][145][145] --- drive error ---"
215 a$="error:"+str$(er)+" "+er$:printtab((20-len(a$)/2)+1)a$
220 print"[154] track:"tr;tab(23)"[154]sector:"se:ok=not(ok):return
225 gosub150:print" [154]press space [154]to return to"
230 print" the main menu":poke198,.
235 ifpeek(203)<>60then235
240 return
245 s$(1)=" view directory "
250 s$(2)=" copy files "
255 s$(3)=" scratch files "
260 s$(4)=" disk command "
265 s$(5)=" quit program "
270 :
275 m$(1)="1. view directory"
280 m$(2)="2. copy files "
285 m$(3)="3. scratch files "
290 m$(4)="4. disk command "
295 m$(5)="5. quit program "
300 return
305 poke55,.:poke56,64:clr:poke650,128
306 dv=peek(186):if dv<8 then dv=8:rem dv defined again because of clr command
307 close15:open15,dv,15,"i":close15
310 poke53280,2:poke53281,.:co=54272
315 op=16384:ni=op+29:en=op+176:rem op is the start address of copier.o
320 sl=16754:up=17633:dn=up+3
325 re=17903:wr=18269:sd=18420
330 dim fi$(144),nb$(144),ft%(144),s%(144),l$(144),nf%,ns%,tr%(144),se%(144)
335 dim sa(145)
340 cs=1:ns=5:dim m$(ns),s$(ns),d(4)
345 t$(.)="del":t$(5)=" deleted "
350 t$(1)="seq":t$(6)="sequential"
355 t$(2)="prg":t$(7)=" program "
360 t$(3)="usr":t$(8)=" user "
365 t$(4)="rel":t$(9)=" relative "
370 sp$=" "
375 printchr$(142)"[147] [158]star copier"
380 print" by mike maynard"
385 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
390 gosub245:gosub165
395 ifflthenpoke214,21:print:goto435
400 gosub130:print" [154]main menu "
405 print"[158][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,7
410 fora=1tons+2
415 print"[150] ";:next
420 print"[146][158][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1623,99:poke1623+co,7
425 poke214,20:print
430 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1903,99:poke1903+co,2
435 print" [154]use the cursor keys [154]to move the"
440 print" reversed area. press return [154]to select.":ifflthen470
445 fora=217to242:pokea,peek(a)or128:next:poke214,7:print
450 fora=1tons
455 ifa=csthenprinttab(11)""m$(a):goto465
460 printtab(11)"[150]"m$(a)
465 next
470 poke214,15:print:print" [145]"
475 print" source device number:[153]"sd%:pokeop+3,sd%
480 print" "
485 poke214,17:print:print" [145]"
490 print" target device number:[153]"td%
495 print" ":ifflthen510
500 poke214,6+ls:print:printtab(11)"[150]"m$(ls)
505 poke214,6+cs:print:printtab(11)""m$(cs)
510 ls=cs:fl=.
515 a=peek(203):ifa<>13anda<>22anda<>1anda<>7anda<>2then515
520 ifa=1then on cs goto595 ,790,1090,1180,1240
525 ifa=13ora=22then565
530 if(peek(653)and1)then550
535 ifa=7thencs=cs+1:ifcs>nsthencs=1
540 ifa=2thencs=cs-1:ifcs=.thencs=ns
545 goto500
550 ifa=7thencs=cs-1:ifcs=.thencs=ns
555 ifa=2thencs=cs+1:ifcs>nsthencs=1
560 goto500
565 ifa=13thensd%=sd%+1:ifsd%=12thensd%=8
570 ifa=22thentd%=td%+1:iftd%=12thentd%=8
575 ifd(sd%-7)=.ord(td%-7)=.then565
580 poke214,15:print:printtab(29)"[153]"sd%"[157] ":pokeop+3,sd%
585 poke214,17:print:printtab(29)"[153]"td%"[157] "
590 goto515
595 gosub200:ifnot(ok)thenfl=1:goto785
600 poke1020,8:poke1021,1:poke1022,40:poke1023,14
605 gosub120:gosub150:print" [154]press: p[154] to pause"
610 print" a[154] to abort"
615 poke214,6:print:sys(op)
620 sys(ni),dn$,bf%:bf$=str$(bf%):bf$=right$("00"+right$(bf$,len(bf$)-1),3)
625 id$=right$(dn$,2):dn$=left$(dn$,16):poke1020,9:poke1023,13
630 poke214,4:print:print"[154] disk name:"dn$tab(33)"[154]id:"id$"[153]":bu%=.:nf%=.
635 print" [158]blks[221] [158]type [221] [158]filename [221][158]trk [221][158]sec":ln%=1:poke198,.
640 sys(en),fi$,nb%,ft%
645 s=.:ifft%<5thens=1
650 ft%=ft%and127
655 nb$=" "+str$(nb%):nb$=right$(nb$,3):ifft%<1then690
660 bu%=bu%+nb%:nf%=nf%+1:ln%=ln%+1:ifln%>14thenln%=14:sysup:print"[145][145]"
665 tr$=right$(" "+str$(peek(re+3)),2):se$=right$(" "+str$(peek(re+4)),2)
670 print" [153]"nb$" [221] ";:if(ft%and64)thenft%=ft%and63:print"[157][156]>";
675 print" ";:if(s)thenprint"[157]*";
680 print"[153]"t$(ft%and15)" [221][153]";:poke212,1:printleft$(fi$+sp$,16);
685 poke212,.:print" [221][153] "tr$" [221][153] "se$
690 geta$:ifa$<>"a"anda$<>"p"then745
695 ifa$="a"then725
700 cl=peek(214):gosub150:print" [158]view directory paused"
705 print" [154]press space [154]to continue":poke198,.
710 ifpeek(203)<>60then710
715 gosub150:print" [154]press: p[154] to pause"
720 print" a[154] to abort[153]":poke214,cl-1:print:goto745
725 ifln%<13then735
730 forb=1to((ln%=13)*-1+(ln%=14)*-2):sysup:print"[145][145]":next
735 print" [150]view directory aborted!":ln%=ln%+2:ifln%>14thenln%=14
740 close3:close15:bu$="???":ot$=bu$:nf$=bu$:goto765
745 ifpeek(2)=.then640
750 bu$=str$(bu%):bu$=right$("00"+right$(bu$,len(bu$)-1),3)
755 ot$=str$(664-bf%-bu%):ot$=right$("00"+right$(ot$,len(ot$)-1),3)
760 nf$=str$(nf%):nf$=right$("00"+right$(nf$,len(nf$)-1),3)
765 ifln%<13then775
770 forb=1to((ln%=13)*-2+(ln%=14)*-3):sysup:print"[145][145]":next
775 print" [158]blocks->[154]free:"bf$" [154]used:"bu$" [154]other:"ot$
780 print"[154] total number of files:"nf$
785 poke1020,8:poke1023,14:gosub225:goto395
790 gosub1340:ifnot(ok)then785
795 gosub1310
800 gosub120:poke214,6:print
805 fora=1to14:printtab(19)"[221]":next
810 poke214,6:print:printtab(5)"[158]reading:"tab(26)"writing:":c1%=.:c2%=.
815 cf%=1:f%=.:ln%=.:ap%=.:fu%=.
820 bf%=1:sa(1)=24458:poke214,c1%+7:print
825 poke1020,9:poke1021,1:poke1022,18:poke1023,13
830 ifs%(cf%)=.then920
835 ifft%(cf%)>4then865
840 ifc1%>11thenforb=1to((c1%=12)*-1+(c1%=13)*-2):sysup:print"[145][145]":next
845 c1%=c1%+1:s%(cf%)=.:a$=fi$(cf%):print
850 print"[145]"tab(10-len(a$)/2)"[150]"a$:printtab(2)"can't copy splat"
855 ns%=ns%-1:ifns%=.then1055
860 goto920
865 c1%=c1%+1:if(c1%>13)and(fu%=.)thenc1%=13:sysup:print"[145][145]"
870 if(fu%)thenprint"[145][145]"
875 a$=fi$(cf%):printtab(10-len(a$)/2)""a$
880 a=sa(bf%):gosub195:poke2